
import defaultLayout from '../layouts/DefaultLayout.vue'

export default [
  {
    path: '/',
    name: 'login',
    // meta: {
    //   title: '登录'
    // },
    component: () => import('@/views/user/login.vue'),
  } ,
  {
    path: '/n',
    name: 'Layout',
    component: defaultLayout,
    meta: {
      title: 'home'
    },
    redirect: 'home',
    children: [
      {
        path: 'home',
        name: 'home',
        meta: {
          title: 'mhome',
          icon: 'el-icon-s-home',
          keepAlive : true, // 需要缓存
        },
        component: () => import('@/views/pages/home')
      },
      {
        path: 'componentlink',
        name: 'componentlink',
        meta: {
          title: 'componentlink',
          icon: 'el-icon-s-home',
          keepAlive : true,
          requiresAuth: false, roles: ['admin'] //是否需要认证，且角色为admin
        },
        component: () => import('@/views/pages/componentlink')
      },
      {
        path: 'link',
        name: 'link',
        meta: {
          title: 'link',
          icon: 'el-icon-paperclip',
          keepAlive : false,
        
        },
        component: () => import('@/views/pages/one.vue')
      },
      {
        path: 'form',
        name: 'form',
        meta: {
          title: 'form',
          icon: 'el-icon-tickets',
          keepAlive : true,
        },
        component: () => import('@/views/pages/two'),
        children: []
      },
      {
        path: 'table',
        name: 'table',
        meta: {
          title: 'table',
          icon: 'el-icon-s-release',
          keepAlive : true,
        },
        component: () => import('@/views/pages/three')
      },
      {
        path: 'card',
        name: 'card',
        meta: {
          title: 'card',
          icon: 'el-icon-bank-card',
        },
        component: () => import('@/views/pages/card')
      }
    ]
  },
  {
    path: '/1',
    component: defaultLayout,
    redirect: 'model',
    meta: {
      title: 'model'
    },
    children: [
      {
        path: 'model',
        name: 'formmodel',
        meta: {
          title: 'formmodel',
          icon: 'el-icon-s-home'
        },
        component: () => import('@/views/form/model.vue'),
        children: [
          {
            path: 'info',
            name: 'info',
            meta: {
              title: 'info',
              icon: 'el-icon-s-home',
              keepAlive : true,
            },
            component: () => import('@/views/form/infoform.vue')
          },
          {
            path: 'apply',
            name: 'apply',
            meta: {
              title: 'applyform',
              icon: 'el-icon-s-home',
              keepAlive : true,
            },
            component: () => import('@/views/form/applyform.vue')
          }
        ]
      },
      {
        path: 'labels',
        name: 'labels',
        meta: {
          title: 'labels'
        },
        component: () => import('@/views/form/labelTemplate/Labels.vue')
      }
    ]
  } ,
  {
    path: '/2',
    component: defaultLayout,
    redirect: 'linechart',
    meta: {
      title: 'echarts'
    },
    children: [
      {
        path: 'linechart',
        name: 'linechart',
        meta: {
          title: 'linechart',
          icon: ''
        },
        component: () => import('@/views/echarts/linechart.vue'),
      },
      {
        path: 'nestedData',
        name: 'nestedData',
        meta: {
          title: 'nestedData',
          icon: ''
        },
        component: () => import('@/views/echarts/nestedData.vue'),
      },
      {
        path: 'echarttest',
        name: 'echarttest',
        meta: {
          title: 'encapsulateEcharts',
          icon: ''
        },
        component: () => import('@/views/echarts/echarttest.vue'),
      }
    ]
  } ,
  {
    path: '/3',
    component: defaultLayout,
    redirect: 'loadTextFile',
    meta: {
      title: 'file'
    },
    children: [
      {
        path: 'loadTextFile',
        name: 'loadTextFile',
        meta: {
          title: 'loadTextFile',
          icon: ''
        },
        component: () => import('@/views/file/loadTextFile.vue'),
      },
      {
        path: 'pdfPreview',
        name: 'pdfPreview',
        meta: {
          title: 'pdfPreview',
          icon: ''
        },
        component: () => import('@/views/file/pdfPreview.vue'),
      },
      {
        path: 'uplolad',
        name: 'uplolad',
        meta: {
          title: 'fileUpload',
          icon: 'el-icon-bank-card'
        },
        component: () => import('@/views/file/fileupload.vue')
      }

    ]
  } ,
  {
    path: '/4',
    component: defaultLayout,
    redirect: 'canvas',
    meta: {
      title: 'image'
    },
    children: [
      {
        path: 'canvas',
        name: 'canvas',
        meta: {
          title: 'canvas',
          icon: ''
        },
        component: () => import('@/views/canvas/canvas.vue'),
      },
      {
        path: 'cube',
        name: 'cube',
        meta: {
          title: 'cube',
          icon: ''
        },
        component: () => import('@/views/canvas/cube.vue'),
      },
      {
        path: 'videoAndAudio',
        name: 'videoAndAudio',
        meta: {
          title: 'videoAndAudio',
          icon: ''
        },
        component: () => import('@/views/canvas/videoAndAudio.vue')
      }

    ]
  } ,
  // {
  //   path: '/2',
  //   component: defaultLayout,
  //   redirect: 'error',
  //   meta: {
  //     title: '错误'
  //   },
  //   children: [
  //     {
  //       path: 'error',
  //       name: '404',
  //       meta: {
  //         title: '错误',
  //         icon: 'el-icon-s-home'
  //       },
  //       component: () => import('@/views/error-page/404')
  //     }
  //   ]
  // },
  // {
  //   path: '/lg1',
  //   name: 'login',
  //   meta: {
  //     title: '登录页',
  //     icon: 'el-icon-s-home'
  //   },
  //   component: () => import('@/views/user/login.vue')
  // },
  // 404
  { path: '*', redirect: '/404', hidden: true },
  { path: '/403', name:'403', hidden: true,component: () => import('@/views/error-page/403.vue') }
]
